1. Field of the Disclosure
Exemplary aspects of the present disclosure relate to a method for setting an offset gain of an analog output module, configured to accurately set an offset gain of an analog output module outputted to an external load device by changing a digital signal outputted from an MPU (Micro Processing Unit) in a PLC (Programmable Logic Controller) to an analog signal.
2. Description of Related Art
Apparatuses for factory automation of various types have emerged concomitant with technical development of automation fields owing to sophisticated technologies. Particularly, a PLC (Programmable Logic Controller) system is a core element for factory automation configured to control various types of equipment, machines and processes in a factory, and effective means configured to satisfy various requirements for factory automation.
The PLC system uses programmable memories for implementing various functions such as logic, sequence, timing, counting and computing through digital or analog input/output modules. The PLC system is mounted with an analog output module for control by being connected to an external load device that operates in response to an analog signal. The analog output module functions to convert a digital signal outputted from an MPU (Micro Processing Unit) to an analog signal, and output the converted analog signal to an external load device.
The analog output module must accurately set an offset gain for calibrating an intrinsic error of the analog output module for accurately controlling the external load device for the analog output module. To this end, a conventional PLC system employed a method of inputting offset gains of various output scopes by anticipating, by an operator, the offset gains in response to values of analog signals outputted by the analog output module.
FIG. 1 is a block diagram illustrating a configuration of a general analog output module, where reference numeral 100 is an MPU (Micro Processing Unit). The MPU (100) functions to generate a digital signal for controlling an operation of an external load device (not shown).
The digital signal generated by the MPU (100) is converted to an analog signal by being inputted to a plurality of analog output units (110) having a plurality of channels, where the converted analog signal is transmitted to an external load device to operate a load device. Each of the plurality of analog output units (110) may include a photo coupler (112), a DAC (Digital to Analog Converter (114), a voltage amplifier (116) and a current amplifier (118).
The photo coupler (112) receives a digital signal outputted by the MPU (100) in a state of being insulated from the MPU (100), where the received digital signal is converted by the DAC (114) to an analog signal. The analog signal converted by the DAC (114) is amplified by the voltage amplifier (116) or the current amplifier (118) and transmitted to an external load device.
That is, the analog voltage signal converted by the DAC (114) is amplified by the voltage amplifier (116) to be transmitted to the external load device, and the analog current signal converted by the DAC (114) is amplified by the current amplifier (118) to be transmitted to the external load device.
FIG. 2 is a signal flowchart illustrating a setting operation of offset gain according to the prior art. Referring to FIG. 2, the MPU (100) first determines whether an analog output module is in a mode for setting an offset gain (S200). As a result of the determination, if it is determined that the analog output module is in the mode for setting an offset gain, the MPU (100) selects an analog output module (110) for setting an offset gain from the plurality of analog output modules (110) having a plurality of channels (S202).
If the one analog output module (110) for setting an offset gain is selected, the MPU (100) performs an initialization operation of the DAC (114) mounted on the analog output module (110) of relevant channel (S204).
Furthermore, the MPU (100) computes a value of a digital signal to be outputted to the analog output module (110) of relevant channel by using a value set on the analog output module (110) of relevant channel for setting an offset gain and an offset gain current set on the analog output module (110) of relevant channel (S206).
If the value of the digital signal is computed, the MPU (100) outputs the computed value of digital signal to the analog output module (110) of relevant channel (110) (S208).
The digital signal outputted by the MPU (100) is insulated and received by the photo coupler (112) mounted on the analog output module (110). Furthermore, the digital signal received by the photo coupler (112) is converted to an analog signal by the DAC (114), and outputted by being voltage-amplified and current-amplified by the voltage amplifier (116) and the current amplifier (118) respectively.
Under these circumstances, an operator measures the value of analog signal outputted by the voltage amplifier (116) and the current amplifier (118) using a meter (S210), and determines whether the measured value of analog signal satisfies a value within an error range (S212).
As a result of determination, if it is determined that the measured value of analog signal fails to satisfy the value within an error range, the operator predicts an offset gain by using the measured value of analog signal, and the predicted offset gain is inputted and set through a ladder program, for example, (S214).
Under these circumstances, the MPU (100) returns to S206 to compute a value of digital signal using a value set on the analog output module (110) of relevant channel and an offset gain newly set on the analog output module (110) of relevant channel and outputs the computed value, where the operator measures a value of an analog signal using a meter and determines whether the value satisfies a condition within an error range, and predicts and sets an offset gain if the value fails to satisfy the condition within the error range, where predicting and setting operations of offset gain are repeated.
However, chances are that the operations of predicting and setting the offset gains using the value of analog signal outputted by the analog output module (110) are frequently repeated due to erroneous input of offset gains by an operator to increase operation time of setting the offset gains and to disadvantageously decrease accuracy of set offset gains.